package cn.yangsen.simplebeanmanager.bean.html;

import lombok.Getter;
import lombok.Setter;
import cn.yangsen.simplebeanmanager.bean.html.itfc.Cleanable;
import cn.yangsen.simplebeanmanager.tool.HtmlTool;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("input")
public class Text extends Input implements Cleanable
{
	@Getter
	@XStreamAsAttribute
	private final InputType type = InputType.Text;
	
	@Getter
	@Setter
	@XStreamAsAttribute
	private int size;

	@Override
	public void setValue(String value)
	{
		super.setValue(HtmlTool.预留字段转字符实体(value));
	}

	@Override
	public void clean()
	{
		setValue(null);
	}
}
